/**
 * Copyright (c) 2019 xstgongyi.org
 * All rights reserved.
 */
package org.xstgongyi.eduaid.controller;

import org.xstgongyi.eduaid.bo.EducationStage;
import org.xstgongyi.eduaid.dataobject.GradeDO;

/**
 * @author oldcrane<br/>
 * @created 2019-04-14
 */
public class GradeVO {

	private Integer id;
	private String name;
	private String code; // 年级编码，主要用于排序
	private EducationStage stage;
	private Boolean graduateGrade; // 是否毕业年级
	private Integer nextGradeId;
	private String nextGradeName;
	private Boolean active;

	public static GradeVO of(GradeDO grade) {
		GradeVO vo = new GradeVO();
		vo.setId(grade.getId());
		vo.setName(grade.getName());
		vo.setCode(grade.getCode());
		vo.setStage(grade.getStage());
		vo.setGraduateGrade(grade.getGraduateGrade());
		vo.setNextGradeId(grade.getNextGradeId());
		vo.setActive(grade.getActive());
		return vo;
	}

	public GradeDO transform() {
		GradeDO grade = new GradeDO();
		grade.setName(this.getName());
		grade.setCode(this.getCode());
		grade.setStage(this.getStage());
		grade.setGraduateGrade(this.getGraduateGrade());
		grade.setNextGradeId(this.getNextGradeId());
		grade.setActive(this.getActive());
		return grade;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public EducationStage getStage() {
		return stage;
	}

	public void setStage(EducationStage stage) {
		this.stage = stage;
	}

	public Boolean getGraduateGrade() {
		return graduateGrade;
	}

	public void setGraduateGrade(Boolean graduateGrade) {
		this.graduateGrade = graduateGrade;
	}

	public Integer getNextGradeId() {
		return nextGradeId;
	}

	public void setNextGradeId(Integer nextGradeId) {
		this.nextGradeId = nextGradeId;
	}

	public String getNextGradeName() {
		return nextGradeName;
	}

	public void setNextGradeName(String nextGradeName) {
		this.nextGradeName = nextGradeName;
	}

	public Boolean getActive() {
		return active;
	}

	public void setActive(Boolean active) {
		this.active = active;
	}

	@Override
	public String toString() {
		return "GradeVO [id=" + id + ", name=" + name + ", code=" + code + ", stage=" + stage + ", graduateGrade="
				+ graduateGrade + ", nextGradeId=" + nextGradeId + ", nextGradeName=" + nextGradeName + ", active="
				+ active + "]";
	}

}
